package com.tang.algorithm.array;

import java.util.Arrays;

/**
 * @author tlm
 * @version 1.0
 * @date 2020/7/11 18:18
 */
public class LeetCode1502 {
    public boolean canMakeArithmeticProgression(int[] arr) {
        boolean flag = true;
        Arrays.sort(arr);
        int in = arr[1] - arr[0];
        for (int i = 0; i < arr.length - 1; i++) {
            if (arr[i + 1] - arr[i] != in) {
                flag = false;
                break;
            }
        }
        return flag;
    }


}
